package com.atguigu.lease.common.context;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2025/1/15 17:18
 * @注释
 */
public class LoginUserContext {

    private static final ThreadLocal<LoginUser> userThreadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        userThreadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return userThreadLocal.get();
    }

    public static void clear() {
        userThreadLocal.remove();
    }
}